import React, { Component } from 'react'

export default class App extends Component {
  state={
    uname:"yaya"
  }

  f1 = (e)=>{
    let v = e.target.value
    v = v.toUpperCase();
    this.setState({uname:v})
  }
  
  render() {
    return (
      <>
        <h2>受控组件</h2>
        <input 
          placeholder='请输入登录名称' 
          value={this.state.uname}
          onChange={this.f1}
        ></input>
      </>
    )
  }
}
